package com.ambitor.ipro.app.gen;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Timer;

public class TaskGeneratorApp {

	public static void main(String[] args) {
		new TaskGenerator().run();

		Calendar cal = Calendar.getInstance();
		cal.add(Calendar.DATE, 1); // 当前时间加1天
		SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd 00:30:00");
		cal.setTime(Timestamp.valueOf(fmt.format(cal.getTime())));
		long period = 1000 * 60 * 60 * 24;
		Timer timer = new Timer();
		timer.scheduleAtFixedRate(new TaskGenerator(), cal.getTime(), period);
	}
}
